package com.gxa.utils;

import com.gxa.common.Q;
import com.gxa.common.R;
import com.gxa.mapper.LsFinanceMapper;
import com.gxa.pojo.Finance;
import com.gxa.pojo.FinanceList;
import com.gxa.pojo.QueryFinanceList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: zdk
 * Date: 2021/12/09 19:07
 * Description:
 * Version: V1.0
 */
public class LsFinanceUtils {
    public static R RUtils(int result){
        R r = new R();
        if (result>=1){
            r.setCode(200);
            r.setMsg("操作成功");
            return r;
        }else {
            r.setCode(500);
            r.setMsg("系统错误");
            return r;
        }
    }
    public static Q QUtils(FinanceList financeLists, Integer count){
        Q q = new Q();
        if(count != null && count>0){
            if(!"".equals(financeLists) && financeLists!=null){
                q.setCode(200);
                q.setMsg("查询成功");
                q.setCount(count);
                q.setData(financeLists);
                return q;
            }else {
                q.setCode(500);
                q.setMsg("操作失败,查询结果集为空");
                return q;
            }
        }else {
            q.setCode(500);
            q.setMsg("操作失败,查询结果集为空");
            return q;
        }
    }

}
